{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "impressed-accessory",
   "metadata": {},
   "source": [
    "## Seldon V2 Kubernetes Model and Server Deletion Tests\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "210dc092",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Release \"seldon-core-v2-crds\" has been upgraded. Happy Helming!\r\n",
      "NAME: seldon-core-v2-crds\r\n",
      "LAST DEPLOYED: Thu Jul 27 10:23:00 2023\r\n",
      "NAMESPACE: seldon-mesh\r\n",
      "STATUS: deployed\r\n",
      "REVISION: 2\r\n",
      "TEST SUITE: None\r\n"
     ]
    }
   ],
   "source": [
    "!helm upgrade --install seldon-core-v2-crds  ../k8s/helm-charts/seldon-core-v2-crds -n seldon-mesh"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "90cf75bb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Release \"seldon-core-v2\" does not exist. Installing it now.\n",
      "NAME: seldon-core-v2\n",
      "LAST DEPLOYED: Thu Jul 27 10:23:03 2023\n",
      "NAMESPACE: seldon-mesh\n",
      "STATUS: deployed\n",
      "REVISION: 1\n",
      "TEST SUITE: None\n"
     ]
    }
   ],
   "source": [
    "!helm upgrade --install seldon-core-v2 ../k8s/helm-charts/seldon-core-v2-setup/ -n seldon-mesh --wait"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "ef3069ca",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Release \"seldon-v2-runtime\" does not exist. Installing it now.\n",
      "NAME: seldon-v2-runtime\n",
      "LAST DEPLOYED: Thu Jul 27 10:23:23 2023\n",
      "NAMESPACE: seldon-mesh\n",
      "STATUS: deployed\n",
      "REVISION: 1\n",
      "TEST SUITE: None\n"
     ]
    }
   ],
   "source": [
    "!helm upgrade --install seldon-v2-runtime ../k8s/helm-charts/seldon-core-v2-runtime   --namespace seldon-mesh --wait"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "9e481bf7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Release \"seldon-v2-servers\" has been upgraded. Happy Helming!\r\n",
      "NAME: seldon-v2-servers\r\n",
      "LAST DEPLOYED: Thu Jul 27 13:50:38 2023\r\n",
      "NAMESPACE: seldon-mesh\r\n",
      "STATUS: deployed\r\n",
      "REVISION: 2\r\n",
      "TEST SUITE: None\r\n"
     ]
    }
   ],
   "source": [
    "!helm upgrade --install seldon-v2-servers ../k8s/helm-charts/seldon-core-v2-servers  -n seldon-mesh --wait"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "91687b33",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "os.environ[\"NAMESPACE\"] = \"seldon-mesh\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "sunrise-commercial",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'172.18.255.2'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "MESH_IP=!kubectl get svc seldon-mesh -n ${NAMESPACE} -o jsonpath='{.status.loadBalancer.ingress[0].ip}'\n",
    "MESH_IP=MESH_IP[0]\n",
    "import os\n",
    "os.environ['MESH_IP'] = MESH_IP\n",
    "MESH_IP"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "3468a659",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "seldonruntime.mlops.seldon.io/seldon condition met\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl wait --for condition=ready --timeout=300s seldonruntime --all -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "8674f2e3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "server.mlops.seldon.io/mlserver condition met\n",
      "server.mlops.seldon.io/triton condition met\n"
     ]
    }
   ],
   "source": [
    "!kubectl wait --for condition=ready --timeout=300s server --all -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "speaking-bracelet",
   "metadata": {},
   "source": [
    "### Check Model can be deleted after Server delete on which it is running"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "exempt-bumper",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "model.mlops.seldon.io/iris created\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl create -f ./models/sklearn-iris-gs.yaml -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "beneficial-logan",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "model.mlops.seldon.io/iris condition met\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl wait --for condition=ready --timeout=300s model --all -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "prepared-duration",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\r\n",
      "  \"conditions\": [\r\n",
      "    {\r\n",
      "      \"lastTransitionTime\": \"2023-07-31T09:54:40Z\",\r\n",
      "      \"message\": \"ModelAvailable\",\r\n",
      "      \"status\": \"True\",\r\n",
      "      \"type\": \"ModelReady\"\r\n",
      "    },\r\n",
      "    {\r\n",
      "      \"lastTransitionTime\": \"2023-07-31T09:54:40Z\",\r\n",
      "      \"status\": \"True\",\r\n",
      "      \"type\": \"Ready\"\r\n",
      "    }\r\n",
      "  ],\r\n",
      "  \"replicas\": 1\r\n",
      "}\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl get model iris -n ${NAMESPACE} -o jsonpath='{.status}' | jq -M ."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "attended-vanilla",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "server.mlops.seldon.io \"mlserver\" deleted\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl delete server mlserver -n ${NAMESPACE} "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "91e18da0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\r\n",
      "  \"conditions\": [\r\n",
      "    {\r\n",
      "      \"lastTransitionTime\": \"2023-07-31T09:54:44Z\",\r\n",
      "      \"message\": \"ScheduleFailed\",\r\n",
      "      \"reason\": \"failed to schedule model iris. [failed replica filter RequirementsReplicaFilter for server replica triton:0 : model requirements [sklearn] replica capabilities [triton dali fil onnx openvino python pytorch tensorflow tensorrt]]\",\r\n",
      "      \"status\": \"False\",\r\n",
      "      \"type\": \"ModelReady\"\r\n",
      "    },\r\n",
      "    {\r\n",
      "      \"lastTransitionTime\": \"2023-07-31T09:54:44Z\",\r\n",
      "      \"message\": \"ScheduleFailed\",\r\n",
      "      \"reason\": \"failed to schedule model iris. [failed replica filter RequirementsReplicaFilter for server replica triton:0 : model requirements [sklearn] replica capabilities [triton dali fil onnx openvino python pytorch tensorflow tensorrt]]\",\r\n",
      "      \"status\": \"False\",\r\n",
      "      \"type\": \"Ready\"\r\n",
      "    }\r\n",
      "  ],\r\n",
      "  \"replicas\": 1\r\n",
      "}\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl get model iris -n ${NAMESPACE} -o jsonpath='{.status}' | jq -M ."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "d7dd152c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Release \"seldon-v2-servers\" has been upgraded. Happy Helming!\r\n",
      "NAME: seldon-v2-servers\r\n",
      "LAST DEPLOYED: Mon Jul 31 10:54:56 2023\r\n",
      "NAMESPACE: seldon-mesh\r\n",
      "STATUS: deployed\r\n",
      "REVISION: 6\r\n",
      "TEST SUITE: None\r\n"
     ]
    }
   ],
   "source": [
    "!helm upgrade --install seldon-v2-servers ../k8s/helm-charts/seldon-core-v2-servers  -n seldon-mesh --wait"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "89721868",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "model.mlops.seldon.io/iris condition met\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl wait --for condition=ready --timeout=300s model --all -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "552ded3c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\r\n",
      "  \"conditions\": [\r\n",
      "    {\r\n",
      "      \"lastTransitionTime\": \"2023-07-31T09:55:01Z\",\r\n",
      "      \"message\": \"ModelAvailable\",\r\n",
      "      \"status\": \"True\",\r\n",
      "      \"type\": \"ModelReady\"\r\n",
      "    },\r\n",
      "    {\r\n",
      "      \"lastTransitionTime\": \"2023-07-31T09:55:01Z\",\r\n",
      "      \"status\": \"True\",\r\n",
      "      \"type\": \"Ready\"\r\n",
      "    }\r\n",
      "  ],\r\n",
      "  \"replicas\": 1\r\n",
      "}\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl get model iris -n ${NAMESPACE} -o jsonpath='{.status}' | jq -M ."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "4796427d",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "server.mlops.seldon.io \"mlserver\" deleted\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl delete server mlserver -n ${NAMESPACE} "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "6ed9a5b6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\r\n",
      "  \"conditions\": [\r\n",
      "    {\r\n",
      "      \"lastTransitionTime\": \"2023-07-31T09:55:24Z\",\r\n",
      "      \"message\": \"ScheduleFailed\",\r\n",
      "      \"reason\": \"failed to schedule model iris. [failed replica filter RequirementsReplicaFilter for server replica triton:0 : model requirements [sklearn] replica capabilities [triton dali fil onnx openvino python pytorch tensorflow tensorrt]]\",\r\n",
      "      \"status\": \"False\",\r\n",
      "      \"type\": \"ModelReady\"\r\n",
      "    },\r\n",
      "    {\r\n",
      "      \"lastTransitionTime\": \"2023-07-31T09:55:24Z\",\r\n",
      "      \"message\": \"ScheduleFailed\",\r\n",
      "      \"reason\": \"failed to schedule model iris. [failed replica filter RequirementsReplicaFilter for server replica triton:0 : model requirements [sklearn] replica capabilities [triton dali fil onnx openvino python pytorch tensorflow tensorrt]]\",\r\n",
      "      \"status\": \"False\",\r\n",
      "      \"type\": \"Ready\"\r\n",
      "    }\r\n",
      "  ],\r\n",
      "  \"replicas\": 1\r\n",
      "}\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl get model iris -n ${NAMESPACE} -o jsonpath='{.status}' | jq -M ."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "396e67f5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "model.mlops.seldon.io \"iris\" deleted\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl delete -f ./models/sklearn-iris-gs.yaml -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "b84424d0",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Release \"seldon-v2-servers\" has been upgraded. Happy Helming!\r\n",
      "NAME: seldon-v2-servers\r\n",
      "LAST DEPLOYED: Mon Jul 31 10:55:35 2023\r\n",
      "NAMESPACE: seldon-mesh\r\n",
      "STATUS: deployed\r\n",
      "REVISION: 7\r\n",
      "TEST SUITE: None\r\n"
     ]
    }
   ],
   "source": [
    "!helm upgrade --install seldon-v2-servers ../k8s/helm-charts/seldon-core-v2-servers  -n seldon-mesh --wait"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4186bd10",
   "metadata": {},
   "source": [
    "### Check Model can be deleted after failed scheduling"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "1419b5db",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "model.mlops.seldon.io/iris created\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl create -f ./models/sklearn-iris-gs-baduri.yaml -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "df3ec0c4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\r\n",
      "  \"conditions\": [\r\n",
      "    {\r\n",
      "      \"lastTransitionTime\": \"2023-07-31T09:38:59Z\",\r\n",
      "      \"message\": \"ModelFailed\",\r\n",
      "      \"reason\": \"Failed to download from gs://seldon-models/scv2/samples/mlserver_1.3.5/iris-notexistent-uri any files\",\r\n",
      "      \"status\": \"False\",\r\n",
      "      \"type\": \"ModelReady\"\r\n",
      "    },\r\n",
      "    {\r\n",
      "      \"lastTransitionTime\": \"2023-07-31T09:38:59Z\",\r\n",
      "      \"message\": \"ModelFailed\",\r\n",
      "      \"reason\": \"Failed to download from gs://seldon-models/scv2/samples/mlserver_1.3.5/iris-notexistent-uri any files\",\r\n",
      "      \"status\": \"False\",\r\n",
      "      \"type\": \"Ready\"\r\n",
      "    }\r\n",
      "  ],\r\n",
      "  \"replicas\": 1\r\n",
      "}\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl get model iris -n ${NAMESPACE} -o jsonpath='{.status}' | jq -M ."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "df03e639",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "model.mlops.seldon.io \"iris\" deleted\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl delete -f ./models/sklearn-iris-gs-baduri.yaml -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "497d97d0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "No resources found in seldon-mesh namespace.\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl get model -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f941bcc1",
   "metadata": {},
   "source": [
    "## Check Models rescheduled when Server deleted\n",
    "\n",
    " * Add models to initial MLServer\n",
    " * Create second MLServer \n",
    " * Delete first MLServer\n",
    " * Model rescheduled\n",
    " "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "0a85a02b",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "model.mlops.seldon.io/iris created\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl create -f ./models/sklearn-iris-gs.yaml -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "d6c9d0d0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "model.mlops.seldon.io/iris condition met\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl wait --for condition=ready --timeout=300s model --all -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "8109cc71",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\r\n",
      "  \"conditions\": [\r\n",
      "    {\r\n",
      "      \"lastTransitionTime\": \"2023-07-31T13:45:56Z\",\r\n",
      "      \"message\": \"ModelAvailable\",\r\n",
      "      \"status\": \"True\",\r\n",
      "      \"type\": \"ModelReady\"\r\n",
      "    },\r\n",
      "    {\r\n",
      "      \"lastTransitionTime\": \"2023-07-31T13:45:56Z\",\r\n",
      "      \"status\": \"True\",\r\n",
      "      \"type\": \"Ready\"\r\n",
      "    }\r\n",
      "  ],\r\n",
      "  \"replicas\": 1\r\n",
      "}\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl get model iris -n ${NAMESPACE} -o jsonpath='{.status}' | jq -M ."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "b4cd54e9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "apiVersion: mlops.seldon.io/v1alpha1\r\n",
      "kind: Server\r\n",
      "metadata:\r\n",
      "  name: mlserver2\r\n",
      "spec:\r\n",
      "  serverConfig: mlserver\r\n"
     ]
    }
   ],
   "source": [
    "!cat ./servers/mlserver2.yaml"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "561b8492",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "server.mlops.seldon.io/mlserver2 created\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl create -f ./servers/mlserver2.yaml -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "db1369ec",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "server.mlops.seldon.io/mlserver condition met\n",
      "server.mlops.seldon.io/mlserver2 condition met\n",
      "server.mlops.seldon.io/triton condition met\n"
     ]
    }
   ],
   "source": [
    "!kubectl wait --for condition=ready --timeout=300s server --all -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "4b635449",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "server.mlops.seldon.io \"mlserver\" deleted\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl delete server mlserver -n ${NAMESPACE} "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "de4faaa9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\r\n",
      "  \"conditions\": [\r\n",
      "    {\r\n",
      "      \"lastTransitionTime\": \"2023-07-31T13:46:15Z\",\r\n",
      "      \"message\": \"ModelAvailable\",\r\n",
      "      \"status\": \"True\",\r\n",
      "      \"type\": \"ModelReady\"\r\n",
      "    },\r\n",
      "    {\r\n",
      "      \"lastTransitionTime\": \"2023-07-31T13:46:15Z\",\r\n",
      "      \"status\": \"True\",\r\n",
      "      \"type\": \"Ready\"\r\n",
      "    }\r\n",
      "  ],\r\n",
      "  \"replicas\": 1\r\n",
      "}\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl get model iris -n ${NAMESPACE} -o jsonpath='{.status}' | jq -M ."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "ddb7c76a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "model.mlops.seldon.io/iris condition met\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl wait --for condition=ready --timeout=300s model --all -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "f60051a7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "model.mlops.seldon.io \"iris\" deleted\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl delete -f ./models/sklearn-iris-gs.yaml -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "bad76bf1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "server.mlops.seldon.io \"mlserver2\" deleted\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl delete -f ./servers/mlserver2.yaml"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "id": "a6a000e0",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Release \"seldon-v2-servers\" has been upgraded. Happy Helming!\r\n",
      "NAME: seldon-v2-servers\r\n",
      "LAST DEPLOYED: Mon Jul 31 14:46:28 2023\r\n",
      "NAMESPACE: seldon-mesh\r\n",
      "STATUS: deployed\r\n",
      "REVISION: 9\r\n",
      "TEST SUITE: None\r\n"
     ]
    }
   ],
   "source": [
    "!helm upgrade --install seldon-v2-servers ../k8s/helm-charts/seldon-core-v2-servers  -n seldon-mesh --wait"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "74a049ab",
   "metadata": {},
   "source": [
    "## Cause OOM on Server and validate Models can be resheduled"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7deabc28",
   "metadata": {},
   "source": [
    "## Model code changes\n",
    "  * remove finalizer but ensure model delete message gets through and Model is marked for deletion.\n",
    "  * Check cases to ensure failures to Delete allow new model to be created with same name.\n",
    "    * Maybe need unique hash so agent can remove Model if new load comes in for smae name with new Hash"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7e0a8067",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
